package com.leyou.information.controller;

import com.leyou.favorite.Favorite;
import com.leyou.favorite.FavoriteDto;
import com.leyou.information.UserInformation;
import com.leyou.information.service.InformationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@Controller
public class InformationController {
    @Autowired
    private InformationService informationService;

    @PostMapping("/informain/addUserInformation")
    public ResponseEntity<Integer> addUserInformation(UserInformation userInformation){
        Integer state = informationService.addUserInformation(userInformation);
        return ResponseEntity.ok(state);
    }

    @GetMapping("/informain/findUserInformationByUserId")
    public ResponseEntity<UserInformation> findUserInformationByUserId(){
        UserInformation userInformation = informationService.findUserInformationByUserId();
        return ResponseEntity.ok(userInformation);
    }

    @GetMapping("/informain/findUserInformationStatus")
    public ResponseEntity<Integer> findUserInformationStatus(){
        Integer status = informationService.findUserInformationStatus();
        return ResponseEntity.ok(status);
    }




}
